function e(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.registerToken = exports.responseResolveIfNeedLogin = exports.checkIfInTabBar = exports.checkIfNeedSignin = void 0;

var r = e(require("../../utils/api-code")), t = e(require("../../utils/user")), n = [ "pages/card/index/index", "pages/contacts/index/index", "pages/mine/mine" ], s = exports.checkIfNeedSignin = function(e) {
    return [ r.default.TOKEN_INVALID, r.default.TOKEN_EXPIRY ].includes(e);
};

exports.checkIfInTabBar = function() {
    var e = getCurrentPages(), r = e[e.length - 1].__route__;
    return n.includes(r);
}, exports.responseResolveIfNeedLogin = function(e) {
    return s(e.code) ? Promise.reject(e) : Promise.resolve(e);
}, exports.registerToken = function(e) {
    var r = e.detail;
    return /fail[\s:]auth[\s:]deny/.test(r.errMsg) ? Promise.reject(r) : t.default.registerToken(r);
};